Repository navigation
feat(install): report a rejected state root at install and doctor time, and offer to fix it - #794
Open
screenleon wants to merge 8 commits into
Open
screenleon wants to merge 8 commits into
screenleon wants to merge 8 commits into
Conversation
…e, and offer to fix it The state writer refuses a state root another account can write to. On a native Windows host with a Codex sandbox account that is the default location, so every state-writing pmctl command stopped after an install that looked fine. - doctor fails with the reason and the fix instead of leaving the first pmctl call to be refused. - install.sh ends with the same warning; --fix-state-root (or a yes at an interactive prompt) creates ~/.pm-dispatch-state owner-only, confirms the guard accepts it, and on native Windows records it as the user's PM_DISPATCH_STATE_ROOT. An existing directory is checked, never re-permissioned; the check stays on. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7
… a person cancel The warning came after the install had finished. It now runs before any change: a person at a terminal chooses y (use ~/.pm-dispatch-state), n (install unchanged) or c (cancel, nothing changed); a scripted install still only warns, and --fix-state-root still repairs without asking. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7
… root exclusively, test repair and consent on every platform Gate remediation: critic-F001 (icacls options rewritten by MSYS), qa-tester-F001/F002 (native-capable repair and y/n/c/existing-destination coverage), security-reviewer-F001 (exclusive creation). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7
… real ACL grant Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7
…tage needs to delete an owner-only directory Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7
…account, not the profile name Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7
…tor's new check accepts them on native Windows A state root made with mkdir -p under the temp root inherits a write grant for another principal on native Windows (e.g. the Codex sandbox group), which Doctor now reports as a failure. The stale and indeterminate detached-run cases create their state root with an owner-only helper instead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P9zqMvS4GeAcn3S3Jw
…ve Windows The repair promises to inspect an existing directory and never change its permissions. The Windows branch of the existing-directory case checked contents and persistence only, so moving the icacls call outside the creation branch would still pass. It now compares the directory's real ACL before and after the repair. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESW7P9zqMvS4GeAcn3S3Jw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doctornow reports a rejected state root as[FAIL]with a concrete fix, instead of tools installing and then failing with "unsafe state root rejected" (the recurring Windows Temp ACL problem from the Codex sandbox group, Native Windows: 默认状态目录因继承来的 CodexSandboxUsers 修改权限被 ACL 守卫拒绝,报错未指明主体也无补救指引 #778/測試隔離:%TEMP% 對 CodexSandboxUsers 有寫入權限時,test-pmctl-context.sh 的 telemetry 案例被 ACL 守衛拒絕 #782).install.shchecks the state root before changing anything. Interactive: asks[y/n/c](create a private state dir and install / install unchanged / cancel). Non-interactive: warns only, unless--fix-state-rootis passed.--fix-state-rootcreates a NEW private dir (~/.pm-dispatch-state, owner-only ACL via icacls or chmod 700), verifies the guard accepts it, and persistsPM_DISPATCH_STATE_ROOT(setxon Windows, prints an export line elsewhere). It never edits an existing directory's ACL and never disables the guard.Tests
test-doctor:case_doctor_unsafe_state_root_fails_with_remedytest-install:test_install_reports_and_fixes_rejected_state_rootPermanent test admissions: case_doctor_unsafe_state_root_fails_with_remedy, test_install_reports_and_fixes_rejected_state_root — contract tests for a user-facing failure and its remedy, added to existing suites.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ESW7P8BvZ5Crn6vi6EA2J7